package com.one.common.common.system.model.param;

import com.amap.api.location.AMapLocation;
import com.one.common.model.http.base.BaseParam;

/**
 * Author: zhulunjun
 * Email: zhulunjun@qq.com
 * CreateDate: 2018/12/17 11:21
 * Description：地址上传参数
 **/
public class UploadGpsParam extends BaseParam {

    /**
     * address1 : magna dolor quis
     * address2 : in dolor ex
     * address3 : ipsum labore incididunt
     * longitude : dolore velit
     * latitude : proident eu in voluptate
     * detail : sit reprehenderit ipsum aliqua
     * city_id : in et anim aut
     */

    private String address1;
    private String address2;
    private String address3;
    private String longitude;
    private String latitude;
    private String detail;
    private String city_id;

    public UploadGpsParam(String longitude, String latitude) {
        this.longitude = longitude;
        this.latitude = latitude;
    }

    public UploadGpsParam(AMapLocation aMapLocation) {
        String address1 = aMapLocation.getProvince();//定位一级地址
        String address2 = aMapLocation.getCity();//定位二级地址
        String address3 = aMapLocation.getDistrict();//定位三级地址
        double longitude = aMapLocation.getLongitude();//经度
        double latitude = aMapLocation.getLatitude();//纬度
        String detail = aMapLocation.getAddress();//定为详细地址
        String city_id = aMapLocation.getAdCode();//城市ID

        setAddress1(address1);
        setAddress2(address2);
        setAddress3(address3);
        setLatitude(latitude+"");
        setLongitude(longitude+"");
        setDetail(detail);
        setCity_id(city_id);
    }

    public UploadGpsParam() {
    }

    public String getAddress1() {
        return address1;
    }

    public void setAddress1(String address1) {
        this.address1 = address1;
    }

    public String getAddress2() {
        return address2;
    }

    public void setAddress2(String address2) {
        this.address2 = address2;
    }

    public String getAddress3() {
        return address3;
    }

    public void setAddress3(String address3) {
        this.address3 = address3;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getCity_id() {
        return city_id;
    }

    public void setCity_id(String city_id) {
        this.city_id = city_id;
    }

    @Override
    public String toString() {
        return "UploadGpsParam{" +
                "address1='" + address1 + '\'' +
                ", address2='" + address2 + '\'' +
                ", address3='" + address3 + '\'' +
                ", longitude='" + longitude + '\'' +
                ", latitude='" + latitude + '\'' +
                ", detail='" + detail + '\'' +
                ", city_id='" + city_id + '\'' +
                '}';
    }
}
